package uk.ac.bath.domains.misc;

import uk.ac.bath.base.Point;
import java.io.*;

public class Point2DInt implements Point {

    public int x;
    public int y;

    /** Creates new Location */
    public Point2DInt() {
        x = y = 0;
    }

    public Point2DInt(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public Object clone() {
        return new Point2DInt(x, y);
    }

    public int getIX() {
        return x;
    }

    public int getIY() {
        return y;
    }

    public int getIZ() {
        return 0;
    }

    public void save(PrintStream out) {
        out.println(x + " " + y);

    }

    public boolean equals(Object o) {
        Point2DInt p2 = (Point2DInt) o;
        if (p2.y != y) {
            return false;
        }
        if (p2.x != x) {
            return false;
        }
        return true;
    }

    public Point2DInt(BufferedReader in) throws IOException {
        x = Integer.parseInt(in.readLine());
        y = Integer.parseInt(in.readLine());

    }

    public void set(Point p) {
        Point2DInt p2 = (Point2DInt) p;
        x = p2.x;
        y = p2.y;
    }

    public float getX() {
        return x;
    }

    public float getY() {
        return y;
    }

    public float getZ() {
        return 0;
    }
}
